﻿namespace WmsApp.WindowControl.PriceAndAmount
{
    //TaxRate				numeric(6,4),--税率
    //PriceTax			numeric(16,4),--单价含税
    //PriceNotTax			numeric(16,4),--单价不含税
    //AmountTax			numeric(16,4),--总价含税
    //AmountNotTax		numeric(16,4),--总价不含税
    //Quantity			numeric(16,4),--入库数量

    /// <summary>
    /// 基类
    /// </summary>
    public abstract class PriceAndAmountArithBase
    {
        protected decimal Price;

        protected PriceAndAmountArithBase(decimal taxRate, decimal price, decimal quantity)
        {
            this.TaxRate = taxRate;
            this.Quantity = quantity;
            this.Price = price;
            this.Compute();
        }

        /// <summary>
        /// 实现类实现计算逻辑
        /// </summary>
        protected abstract void Compute();

        /// <summary>
        ///税率
        /// </summary>
        public decimal TaxRate { get; protected set; }

        /// <summary>
        /// 单价含税
        /// </summary>
        public decimal PriceTax { get; protected set; }

        /// <summary>
        /// 单价不含税
        /// </summary>
        public decimal PriceNotTax { get; protected set; }

        /// <summary>
        /// 金额含税
        /// </summary>
        public decimal AmountTax { get; protected set; }

        /// <summary>
        /// 金额不含税
        /// </summary>
        public decimal AmountNotTax { get; protected set; }

        /// <summary>
        /// 数量
        /// </summary>
        public decimal Quantity { get; protected set; }
    }
}